package com.yjzx.util.common.util.batch.mergingLimit;

import java.util.*;

/**
 * @author guozhi
 * @date 2025/1/13
 * @description PagingSlotManager
 */
public class PagingSlotManager<T,R> implements SlotManager<PagingSlot<T, R>>{
    Set<PagingSlot<T, R>> mergingSlots;

    public PagingSlotManager() {
        this.mergingSlots = new HashSet<>();
    }

    public PagingSlotManager(PagingSlot<T, R>[] newTimeMergingSlot) {
        this();
        for (PagingSlot<T, R> mergingSlot : newTimeMergingSlot) {
            addSlot(mergingSlot);
        }
    }

    @Override
    public Collection<PagingSlot<T, R>> getAllSlot() {
        return mergingSlots;
    }

    @Override
    public void addSlot(PagingSlot<T, R> trPagingSlot) {
        mergingSlots.add(trPagingSlot);
    }
}
